﻿using System.Collections.Generic;
using System.Configuration;
using Abp.Configuration;
using Abp.Json;

namespace Magicodes.WeChat.Configuration
{
    /// <summary>
    /// 定义公众号相关设置
    /// </summary>
    public class WeChatSettingProvider : SettingProvider
    {
        public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
        {
            var defaultWeChatApiSetting = new WeChatApiSetting
            {
                AppId = "",
                AppSecret = "",
                Token = "",
                WeiXinAccount = ""
            };

            var defaultWeChatPayApiSetting = new WeChatPayApiSetting()
            {

            };

            return new[]
                   {
                       //Host settings/Tenant settings
                       //微信设置
                        new SettingDefinition(WeChatSettings.TenantManagement.WeChatApiSettings, defaultWeChatApiSetting.ToJsonString(),scopes: SettingScopes.Application | SettingScopes.Tenant, isVisibleToClients: false),

                        //微信支付设置
                        new SettingDefinition(WeChatSettings.TenantManagement.WeChatPayApiSettings,defaultWeChatPayApiSetting.ToJsonString(),scopes:SettingScopes.Application | SettingScopes.Tenant, isVisibleToClients: false),

                       //微信自定义菜单设置
                       new SettingDefinition(WeChatSettings.TenantManagement.WeChatCustomMenuSettings,null,scopes:SettingScopes.Application | SettingScopes.Tenant, isVisibleToClients: false)
                   };
        }
    }
}
